$(document).ajaxSend(function(e, xqr, op){
    var token = localStorage.getItem("user_token");
    xqr.setRequestHeader("user_token",token);
}); // 此处要求在法统的时候统一执行什么

function getUserInfo(url){
    $.ajax({
        type:"get",
        url:url,
        success:function(result){
            if(result.code == 200 && result.data != null){
                // 页面填充
                var user =result.data;
                $(".left .card h3").text(user.userName);
                $(".left .card a").attr("href",user.gitubUrl);
            }else{
                location.href="blog_login.html";
            }
        }
    });
}

function logout(){
    localStorage.removeItem("user_token");
    location.href = "blog_login.html";
}